<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .inner {
            min-height: 400px;
            background: gray;
            margin: 0px auto;
            overflow: hidden;
        }

        .each {
            background-color: lightsalmon;
            float: left;
            text-align: center;
            border-radius: 4px;
        }

        .wrap {
            border: 1px red solid;
            position: relative;

        }

        .inner {
            position: relative;
            top: 0;

        }

        .content {
            position: relative;
            top: -400px;
            margin-left: 50px;
            height: 400px;
            overflow: hidden;
            
        }
    </style>
</head>

<body>


    <div id="app">

        <div class="wrap" v-bind:style="{'width':pagerWidth+100+'px'}">


            <div class="inner" v-bind:style="{'width':pagerWidth+'px'}">


            </div>

            <div class="content">
                <div class="line" v-for="line in [1,2,3,4,5,6,7,8,9]" :key="line">
                    <div class="each" v-for="item in [1,2,3,4]" :key="item"
                        v-bind:style="{'width':labelWidth+'px','height':labelHeight+'px','lineHeight':labelHeight+'px','marginLeft':columnMargin+'px','marginTop':rowMargin+'px'}">
                        {{item}}
                    </div>
                </div>

            </div>




        </div>




    </div>

    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>
        var vueApp = new Vue({
            el: '#app',
            data: {

                pagerWidth: 220, //纸宽

                labelWidth: 55, // 标签宽
                labelHeight: 70, // 标签宽

                lineNumber: 4,

                columnMargin: 6, //横向边距
                rowMargin: 3, //标签间隔

                rowNumber:2,//行



                canNum: 1,





            },
            created: function () {
                this.abc();
            },
            methods: {
                abc() {

                    var canW = this.pagerWidth - (this.bianju * 2);

                    var can_num = Math.floor(canW / this.labelWidth);

                    var margin_sum = canW % this.labelWidth;

                    var margin_each = margin_sum / (can_num - 1);

                    console.log(canW);
                    console.log(can_num);
                    console.log(margin_sum);
                    console.log(margin_each);


                },

            },

        });
    </script>

</body>

</html>